import request from "@/utils/request";

export function queryGoods(params) {
  return request({
    url: '/goods/query/' + params,
    method: 'get'
  })
}

export function queryGoodsHistory(params) {
  return request({
    url: '/goods/queryRecentlyPrice/' + params,
    method: 'get'
  })
}

export function queryCustom(params) {
  return request({
    url: '/custom/query/' + params,
    method: 'get'
  })
}

export function queryGoodsCustomHistory(data) {
  return request({
    url: '/goods/queryHistoryPrice',
    method: 'post',
    data
  })
}

export function queryZD(data) {
  return request({
    url: '/chzd/query',
    method: 'post',
    data
  })
}

export function getZDdetail(param) {
  return request({
    url: '/chzd/querydetail/' + param,
    method: 'get'
  })
}

export function getEffi() {
  return request({
    url: '/efficiency/query',
    method: 'get'
  })
}

export function getTodayEffi() {
  return request({
    url: '/efficiency/getTodayEffi',
    method: 'get'
  })
}

export function getRecentZD() {
  return request({
    url: '/chzd/queryRecentZD',
    method: 'get'
  })
}

export function getThatDayZD(data) {
  return request({
    url: '/chzd/querythatDayZD',
    method: 'post',
    data
  })
}

export function getThatDayJH(data) {
  return request({
    url: '/chzd/querythatDayJH',
    method: 'post',
    data
  })
}

export function getJHdetail(param) {
  return request({
    url: '/chzd/queryJHdetail/' + param,
    method: 'get'
  })
}

export function queryJH(data) {
  return request({
    url: '/chzd/queryJH',
    method: 'post',
    data
  })
}

export function ckQuery(data) {
  return request({
    url: '/ck/query',
    method: 'post',
    data
  })
}

export function getSumStatistic(data) {
  return request({
    url: '/efficiency/getSumStatistic',
    method: 'post',
    data
  })
}

export function ckSaleQuery(data) {
  return request({
    url: '/ck/sale',
    method: 'post',
    data
  })
}

export function ckSaleDetail(data) {
  return request({
    url: '/ck/saleDetail/'+ data,
    method: 'get'
  })
}

export function ckPurQuery(data) {
  return request({
    url: '/ck/pur',
    method: 'post',
    data
  })
}

export function ckPurDetail(data) {
  return request({
    url: '/ck/purDetail/'+ data,
    method: 'get'
  })
}

export function getUsers() {
  return request({
    url: '/sys/loginNameget/',
    method: 'get'
  })
}

export function getLogs() {
  return request({
    url: '/sys/getlog/',
    method: 'get'
  })
}

export function queryOrderZd(data) {
  return request({
    url: '/chzd/queryOrderZd',
    method: 'post',
    data
  })
}

export function queryOrderZdDetail(data) {
  return request({
    url: '/chzd/queryOrderZdDetail/' + data,
    method: 'get'
  })
}

export function queryOrderZdWithKhname(data) {
  return request({
    url: '/chzd/queryOrderZdWithKhname',
    method: 'post',
    data
  })
}

export function hasReadZd(data,dhtype) {
  return request({
    url: '/chzd/hasReadZd/' + data + '/' + dhtype,
    method: 'get'
  })
}

export function hasQuestZd(data, dhtype) {
  return request({
      url: '/chzd/hasQuestZd/' + data + '/' + dhtype,
    method: 'get'
  })
}

export function getQuestZD(dhtype) {
  return request({
    url: '/chzd/getQuestZD/' + dhtype,
    method: 'get'
  })
}

export function statisticPageDetail(data) {
  return request({
    url: '/statistic/pageDetail2',
    method: 'post',
    data
  })
}

export function advanceQueryZd(data) {
  return request({
    url: '/statistic/advanceQueryZd',
    method: 'post',
    data
  })
}

export function getZdOne(dh) {
  return request({
    url: '/chzd/getOne?dh=' + dh,
    method: 'post'
  })
}

export function getOrderZdOne(dh) {
  return request({
    url: '/chzd/orderGetOne?dh=' + dh,
    method: 'post'
  })
}

export function advanceQueryMx(data) {
  return request({
    url: '/statistic/advanceQueryMx',
    method: 'post',
    data
  })
}

// 查询订单账单
export function advanceQueryOrderZd(data) {
  return request({
    url: '/statistic/advanceQueryOrderZd',
    method: 'post',
    data
  })
}

// 查询订单账单明细
export function advanceQueryOrderMx(data) {
  return request({
    url: '/statistic/advanceQueryOrderMx',
    method: 'post',
    data
  })
}

// 导出高级查询excel
export function exportAdvanceExcel(data, type) {
  return request({
    url: '/statistic/exportAdvanceExcel?type=' + type,
    method: 'post',
    data,
    config: {
      responseType: 'blob'
    }
  })
}

export function getAlertGoods() {
  return request({
    url: '/goods/getAlertGoods',
    method: 'post'
  })
}
